package vfrpt

class PersonnelWorkController {
    def dynamicQueryService
    def personnelWork(){
        def pageCurrent = params.pageCurrent ? Integer.parseInt(params.pageCurrent) : 1
        def pageSize = params.pageSize ? Integer.parseInt(params.pageSize) : 100
        params.startno = (pageSize * (pageCurrent - 1)) + 1
        params.endno = pageSize * pageCurrent
        def tableHeadList=[]
        def personnelWork=[]
        def pageSizeList = [10,20,50,100]
        def totalCount =0

        if(params.EXPORT_CONTENT_NAME=='Excel'){
            params.SYS_QUERY_NAME = 'personnelWork'
            personnelWork = dynamicQueryService.queryForList(params)
            if (personnelWork.size() > 0) {
                tableHeadList = personnelWork[0].keySet()

            }
            params.SYS_QUERY_NAME = 'personnelWorkCount'
            totalCount = dynamicQueryService.queryForList(params)[0].TOTALCOUNT

        }


        [startno:params.startno?:'',
         endno:params.endno?:'',
         pageSize:pageSize,
         totalCount: totalCount,
         pageSizeList: pageSizeList,
         tableHeadList:tableHeadList,
         personnelWork:personnelWork,
         startTime:params.startTime?:'',
         endTime:params.endTime?:'',
         partName:params.partName?:'',
         tuhao:params.tuhao?:'',
         startDocId:params.startDocId?:'',
         endDocId:params.endDocId?:'',
         stepName:params.stepName?:'',
         lotId:params.lotId?:'',
         oper:params.oper?:''
        ]
    }
}
